package com.atguigu.dao;

import com.atguigu.bean.Employee;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author 伟哥
 * @date 2021-06-04 18:09
 */
public interface EmployeeDaoAnnotation {

    @Select("select * from t_employee where id = #{id}")
    Employee getEmpById(Integer id);

    @Update("UPDATE t_employee " +
                "SET empname = #{empname},gender = #{gender},email = #{email} " +
                "WHERE id = #{id}")
    public int updateEmployee(Employee employee);


    @Delete("DELETE FROM t_employee WHERE id = #{id}")
    public boolean deleteEmployee(Integer id);


    @Insert("INSERT INTO t_employee (empname,gender,email) " +
                "VALUES(#{empname},#{gender},#{email})")
    public int insertEmployee(Employee employee);
}
